package com.dianping.cat.consumer.state.model.entity;

import com.dianping.cat.consumer.state.model.BaseEntity;
import com.dianping.cat.consumer.state.model.IVisitor;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;




public class ProcessDomain
  extends BaseEntity<ProcessDomain>
{
  private String m_name;
/*  17 */   private Set<String> m_ips = new LinkedHashSet();

  private long m_total;

  private long m_totalLoss;

  private double m_size;

  private double m_avg;

/*  27 */   private Map<Long, Detail> m_details = new LinkedHashMap();





/*  33 */   public ProcessDomain(String name) { this.m_name = name; }




/*  38 */   public void accept(IVisitor visitor) { visitor.visitProcessDomain(this); }


  public ProcessDomain addDetail(Detail detail) {
/*  42 */     this.m_details.put(detail.getId(), detail);
/*  43 */     return this;
  }

  public ProcessDomain addIp(String ip) {
/*  47 */     this.m_ips.add(ip);
/*  48 */     return this;
  }


  public boolean equals(Object obj) {
/*  53 */     if (obj instanceof ProcessDomain) {
/*  54 */       ProcessDomain _o = (ProcessDomain)obj;

/*  56 */       if (!equals(getName(), _o.getName())) {
/*  57 */         return false;
      }

/*  60 */       return true;
    }

/*  63 */     return false;
  }


/*  67 */   public Detail findDetail(Long id) { return (Detail)this.m_details.get(id); }


  public Detail findOrCreateDetail(Long id) {
/*  71 */     Detail detail = (Detail)this.m_details.get(id);

/*  73 */     if (detail == null) {
/*  74 */       synchronized (this.m_details) {
/*  75 */         detail = (Detail)this.m_details.get(id);

/*  77 */         if (detail == null) {
          detail = new Detail(id);
/*  79 */           this.m_details.put(id, detail);
        }
      }
    }

/*  84 */     return detail;
  }


/*  88 */   public double getAvg() { return this.m_avg; }



/*  92 */   public Map<Long, Detail> getDetails() { return this.m_details; }



/*  96 */   public Set<String> getIps() { return this.m_ips; }



/* 100 */   public String getName() { return this.m_name; }



/* 104 */   public double getSize() { return this.m_size; }



/* 108 */   public long getTotal() { return this.m_total; }



/* 112 */   public long getTotalLoss() { return this.m_totalLoss; }





  public void mergeAttributes(ProcessDomain other) {
/* 126 */     assertAttributeEquals(other, "processDomain", "name", this.m_name, other.getName());

/* 128 */     this.m_total = other.getTotal();

/* 130 */     this.m_totalLoss = other.getTotalLoss();

/* 132 */     this.m_size = other.getSize();

/* 134 */     this.m_avg = other.getAvg();
  }


/* 138 */   public Detail removeDetail(Long id) { return (Detail)this.m_details.remove(id); }


  public ProcessDomain setAvg(double avg) {
/* 142 */     this.m_avg = avg;
/* 143 */     return this;
  }

  public ProcessDomain setName(String name) {
/* 147 */     this.m_name = name;
/* 148 */     return this;
  }

  public ProcessDomain setSize(double size) {
/* 152 */     this.m_size = size;
/* 153 */     return this;
  }

  public ProcessDomain setTotal(long total) {
/* 157 */     this.m_total = total;
/* 158 */     return this;
  }

  public ProcessDomain setTotalLoss(long totalLoss) {
/* 162 */     this.m_totalLoss = totalLoss;
/* 163 */     return this;
  }

  public ProcessDomain() {}
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/lib/cat-consumer-3.0.0.jar!/com/dianping/cat/consumer/state/model/entity/ProcessDomain.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */